//
//  SoundController.h
//  AloneInTheLight
//
//  Created by George Karalis on 10/2/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ObjectAL.h"


@interface SoundController : NSObject {
    // For sound effects
    ALDevice* device;
    ALContext* context;
    ALChannelSource* channel;
    
    // ALBuffers for effects
    ALBuffer* splashBuffer;
    ALBuffer* singBuffer;
    ALBuffer* shard1Buffer;
    
    // Tracks
    OALAudioTrack* windTrack;
    
    ALSource* singSource;
    
    long double nextSingPitch;
    long double currSingPitch;
    long double ramp;
    
    NSInteger fadeStep;
}

- (void) startGameStartSounds;
- (void) pauseAllSounds;
- (void) resumeAllSounds;
- (void) stopAllSounds;

- (void) startSinging;
- (void) stopSinging;

- (void) startShardFlockSounds;
- (void) stopShardFlockSounds;

- (void) playSplash;
- (void) playFootstep;
- (void) playActivateShard: (NSInteger) sound; // So each can have a different sound

- (void) setSingPitch: (long double) frequency;
- (void) updateSingPitch; 

- (void) onFadeComplete: (id) sender;


@end
